FROM centos
RUN yum install wget -y && rm -f /etc/yum.repos.d/* && \
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo && \
    yum clean all && yum makecache && \
    mkdir -p /root/php && mkdir -p /usr/local/php && yum install \
    gcc libxml2-devel curl curl-devel bison bison-devel zlib-devel libmcrypt-devel mcrypt mhash-devel openssl-devel libcurl-devel bzip2-devel readline-devel libedit-devel sqlite-devel jemalloc jemalloc-devel make \
     -y && \
    yum clean all && \
    /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone && \
    wget -O /root/php/php.tar.gz http://192.168.200.104/php-7.3.4.tar.gz && \
    cd /root/php && tar -xf php.tar.gz   --strip-components 1 && \
    cd /root/php && \
    ./configure --prefix=/usr/local/php  --with-config-file-path=/usr/local/php/etc  \
    --enable-fpm \
    --with-mysqli=mysqlnd \
    --with-pdo-mysql=mysqlnd \
    --with-curl \
    --with-gettext \
    --enable-mbstring \
    --with-iconv \
    --enable-opcache && \
    make -j && make install && \
    cp /root/php/sapi/fpm/init.d.php-fpm /usr/bin/php_fpm && chmod 777 /usr/bin/php_fpm && \
    cp /root/php/php.ini-development /usr/local/php/etc/php.ini && \
    ln -s /usr/local/php/bin/* /usr/local/bin && \
    ln -s /usr/local/php/sbin/* /usr/local/bin && \
    rm -rf /root/php
EXPOSE 9000
CMD ["php-fpm", "-y", "/usr/local/php/etc/php-fpm.conf", "-F"]
